package comm.dhee.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class SetFilter implements Filter {

	public void destroy() {

	}

	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException {
		request.setCharacterEncoding("UTF-8");
		/*		HttpServletRequest httpRequest = (HttpServletRequest) request;
		HttpServletResponse httpResponse = (HttpServletResponse) response;
			String uri = httpRequest.getRequestURI();
		if (!uri.equals("/dhee1.0/logon.do")) {
			if (!uri.equals("/dhee1.0/logon/logon.do")) {
				String username = (String) httpRequest.getSession()
						.getAttribute("username");
				if (username == null) {
					httpResponse.sendRedirect(httpRequest.getContextPath());
				}
			}
		}*/
		chain.doFilter(request, response);
	}

	public void init(FilterConfig arg0) throws ServletException {

	}

}
